package binary;

public class ComplementDemo {
    public static void main(String[] args) {
        int max=Integer.MAX_VALUE;//011111....
        int min=Integer.MIN_VALUE;//10000000...
        System.out.println(Integer.toBinaryString(max));
        System.out.println(Integer.toBinaryString(min));
        System.out.println(Integer.toBinaryString(-1));//11111....

        int n=-45;
        System.out.println(Integer.toBinaryString(-45));//负数的计算：-1-0位置的权，-1-4-8-32=-45
        System.out.println(n);


    }
}
